<template>
  <div id="footer">
    <div v-if="isLogin">
      <span @click="deleteBlog"><i class="iconfont iconshanchu"></i><span>删除</span></span>
      <span @click="editBlog"><i class="iconfont iconbianji"></i><span>编辑</span></span>
    </div>
    <div class="Way">
    <label-way :way="way" ></label-way>
    </div>
  </div>
</template>

<script>
import Bus from "../../bus"
import {state} from '../../store.js'
import LabelWay from "../../components/label" 
export default {
  components:{
    LabelWay
  },
  props:['way',"id"],
  data() {
    return {
    }
  },
  computed: {
    isLogin(){
      return state.isLogin&&this.$store.getters.user.status==="876ea4f21078c7d38e3b0bdc74a"
    },
    EditBlog(){
      return state.EditBlog
    },
    showTip(){
      return state.showTip
    },
    showBlogOption(){
      if(this.$store.getters.user.status==="876ea4f21078c7d38e3b0bdc74a"&&localStorage.LoginToken){
      return true
    }else{
      return false
    }
    }
  },
  methods: {
    deleteBlog(){
      state.showTip=true
    },
    cancelDel(){
      state.showTip=false
    },
    editBlog(){
      state.EditBlog=true
      this.$axios.get("/blog/list",{
        params:{
          id:this.id,
          status: this.$store.getters.user.status
        }
      }).then(res=>{
        console.log(res)
        if(res.data.error===-1){
        Bus.$emit("editContent",{editContent:res.data.data[0].editContent,id:this.id,title:res.data.data[0].title})
        }
      })
    },
  },

}
</script>

<style lang="less" scoped>
@media screen and (max-width: 765px) {
  #footer{
  position: relative;
  z-index: 5;
  height: 20px;
  bottom: 17px;
  span{
    margin-left: 15px;
  }
  .Way{
    // display: inline-block;
    width: 80px;
    height: 15px;
    padding:0 20px;
    overflow: hidden;
    position: absolute;
    right: 15px;
    bottom: 5px;
  }
}
}

@media screen and (min-width: 765px) {
  #footer{
    position: relative;
  height: 11%;

  span{
    margin-left: 15px;
  }
  .Way{
    // display: inline-block;
    width: 80px;
    height: 15px;
    padding:0 20px;
    overflow: hidden;
    position: absolute;
    right: 15px;
    bottom: 3px;
  }
}
}
</style>